package com.heima.media.controller;

import com.heima.common.dto.ResponseResult;
import com.heima.media.entity.WmUser;
import com.heima.media.service.IWmUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 自媒体用户信息表 前端控制器
 * </p>
 *
 * @author SpaceTraveller
 * @since 2022-11-07
 */
@RestController
@RequestMapping("/check")
@Api(tags = "自媒体用户信息表接口")
public class WmUserController{

    @Autowired
    private IWmUserService wmUserService;

    /**
     * 新增自媒体用户
     * @param user
     * @return
     */
    @PostMapping("/apply")
    @ApiOperation(value = "新增自媒体用户",notes = "author:SpaceTraveller")
    @ApiImplicitParam(name = "user",value = "请求体对象",required = true,dataType = "WmUser")
    public ResponseResult<WmUser> insertWmUser(@RequestBody WmUser user){
        return wmUserService.insertWmUser(user);
    }
    /**
     * 新增自媒体用户
     * @param user
     * @return
     */
    @PostMapping("/update")
    @ApiOperation(value = "更新自媒体用户",notes = "author:SpaceTraveller")
    @ApiImplicitParam(name = "user",value = "请求体对象",required = true,dataType = "WmUser")
    public ResponseResult<WmUser> updateWmUser(@RequestBody WmUser user){
        return wmUserService.updateWmUser(user);
    }

}
